package com.xiaoyu.util2;

import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class PrintUtil {
	public static void println(String str) {
		System.out.println(DateUtil.DateTime() + " -> " + str);
	}

	public static void println(Object obj) {
		System.out.println(DateUtil.DateTime() + " -> " + obj.toString());
	}

	public static void print(String str) {
		System.out.println(str);
	}

	@SuppressWarnings("rawtypes")
	public static void print(List<?> list) {
		if (ValidUtil.isValid(list)) {
			Iterator iter = list.iterator();
			while (iter.hasNext())
				print(iter.next().toString());
		}
	}

	@SuppressWarnings("rawtypes")
	public static void print(Map map) {
		if (ValidUtil.isValid(map)) {
			Set set = map.entrySet();
			Iterator iter = set.iterator();
			while (iter.hasNext()) {
				Map.Entry temp = (Map.Entry) iter.next();
				print(temp.getKey() + "--->" + temp.getValue());
			}
		}
	}

	@SuppressWarnings("rawtypes")
	public static void print(Enumeration enums) {
		while ((ValidUtil.isValid(enums)) && (enums.hasMoreElements()))
			print(enums.nextElement() + "~");
	}
}